<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="common/include :: header('物品出入库明细')" />
</head>
<body class="gray-bg">
	<div class="container-div">
		<div class="row">

	        <div class="col-sm-12 select-table table-striped">
			    <table id="bootstrap-table"></table>
			</div>
		</div>
	</div>
	<th:block th:include="common/include :: footer" />
	<script th:inline="javascript">
		var prefix = ctx + "/business/goods";
		$(function() {
		    var options = {
		        url: prefix + "/goodsItem?id="+[[${id}]],
		        columns: [
		        {
		            field: 'id',
		            title: '序号',
					visible: true,
                    formatter:function (value,row,index) {
                        //获取每页显示的数量
                        var pageSize = $('#bootstrap-table').bootstrapTable('getOptions').pageSize;
                        //获取当前是第几页
                        var pageNumber = $('#bootstrap-table').bootstrapTable('getOptions').pageNumber;
                        //返回序号
                        return pageSize * (pageNumber - 1) + index + 1;
                    }
		        },
		        {
		            field: 'type',
		            title: '类型',
		            sortable: true,
                    formatter:function (value) {
		                return value == 0 ? '入库' : '出库'
                    }
		        },

		        {
		            field: 'busiDate',
		            title: '操作时间',
		            sortable: true
		        },
		        {
		            field: 'goodName',
		            title: '物品',
		            sortable: true
		        },
				{
					field: 'brand',
					title: '品牌',
					sortable: true
				},
				{
					field: 'amounts',
					title: '数量',
					sortable: true
				},
				{
					field: 'price',
					title: '价格',
					sortable: true
				}]
		    };
		    $.table.init(options);
		});

	</script>
</body>
</html>